#include <iostream>
#include <boost/dynamic_bitset.hpp>
#include <fstream>
#include <iomanip>
#include <string>
#include <cstdio>
#include <utility>
#include <math.h>
#include <bitset>
#include <map>

long file_size(const char* file_name);
boost::dynamic_bitset<>* GetLFSFfromFile(const char * file_name);
double CalculateQuantile(double A, const char* file_name);
void ComputeCandN (double ta, double tb, double p1, double p2, double& val_1, double& val_2);
void CreateLFSRdump(boost::dynamic_bitset<>* L, int N, std::map<boost::dynamic_bitset<>*,int >* LFSRex,boost::dynamic_bitset<>* lfsr_z);
void MapToFile(std::map<boost::dynamic_bitset<>*,int>* Map_lfsr, const char* file_name);
void Filter_map(std::map<boost::dynamic_bitset<>*, int >* Map_lfsr ,int C);

extern boost::dynamic_bitset<> LFSRpolL1;
extern boost::dynamic_bitset<> LFSRpolL2;
extern boost::dynamic_bitset<> LFSRpolL3;